package it.unisa.beans;

import java.io.Serializable;
import java.sql.Date;
import java.sql.Time;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;

@Entity
public class Photo {
	public Photo(){
		
	}	

	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public Date getDate() {
		return date;
	}
	public void setDate(Date date) {
		this.date = date;
	}
	public Time getHour() {
		return hour;
	}
	public void setHour(Time hour) {
		this.hour = hour;
	}
	public String getDescription() {
		return description;
	}
	public void setDescription(String description) {
		this.description = description;
	}
	public String getTitle() {
		return title;
	}
	public void setTitle(String title) {
		this.title = title;
	}
	public int getPositionX() {
		return positionX;
	}
	public void setPositionX(int positionX) {
		this.positionX = positionX;
	}
	public int getPositionY() {
		return positionY;
	}
	public void setPositionY(int positionY) {
		this.positionY = positionY;
	}
	public String getUrl() {
		return url;
	}
	public void setUrl(String url) {
		this.url = url;
	}
	public Petroglyph getPetroglyph() {
		return petroglyph;
	}
	public void setPetroglyph(Petroglyph petroglyph) {
		this.petroglyph = petroglyph;
	}
	public Set<Comment> getComments() {
		return comments;
	}
	public void setComments(Set<Comment> comments) {
		this.comments = comments;
	}
	public Account getAccount() {
		return account;
	}
	public void setAccount(Account account) {
		this.account = account;
	}
	public Contour getContour() {
		return contour;
	}
	public void setContour(Contour contour) {
		this.contour = contour;
	}





	@Id
	@Column(name="id_photo" )
	private int id;
	private Date date;
	private Time hour;
	private String description;
	private String title;
	private int positionX;
	private int positionY;
	private String url;
	@ManyToOne
	@JoinColumn(name="id_petroglyph")
	private Petroglyph petroglyph;
	@OneToMany(fetch = FetchType.EAGER,mappedBy="photo")
	private Set<Comment> comments=new HashSet<Comment>();
	@ManyToOne
	@JoinColumn(name="ssn_account")
	private Account account;
	@ManyToOne
	@JoinColumn(name="url_contour")
	private Contour contour;
	
}
